﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RequisicaoEscolha.aspx.cs" Inherits="welwitschia.Requisicoes.RequisicaoEscolha" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" language="javascript">
        $(function () {
            $("#<%=txtDataEncomenda.ClientID%>").datepicker();
           
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
      <div id="header" class="info">
            <h2>
                Unidades</h2>
        </div>
    <div>
        <asp:Label ID="lblDataEncomenda" Text="Data:" runat="server"></asp:Label>
        <asp:TextBox ID="txtDataEncomenda" runat="server"></asp:TextBox>
        <asp:Button ID="btnPesquisar" runat="server" Text="Pesquisar" onclick="btnPesquisar_Click"  />
    </div>
        
    <asp:ListView runat="server" ID="lvContratos"  DataKeyNames="NumeroContrato" 
            onitemdeleting="lvContratos_ItemDeleting" 
            onitemediting="lvContratos_ItemEditing" 
            onitemcommand="lvContratos_ItemCommand">
        <LayoutTemplate>
             <table runat="server" class="grd2" id="table2">
                <thead>
                     <tr class="ghdr2">
                     <td>
                       <asp:Label ID="Label2" runat="server">Cliente</asp:Label>
                     </td>
                     <td>
                        <asp:Label ID="Label3" runat="server">Unidade</asp:Label>
                     </td>
                     <td>
                        &nbsp;
                     </td>
                     </tr>
                </thead>
                <tr runat="server" id="itemPlaceholder">
                </tr>
            </table>
        </LayoutTemplate>
        <ItemTemplate>
            <tr id="Tr1" class='grd2<%#Container.DataItemIndex % 2 %>'>
                <td id="Td1" runat="server">
                    <%-- Data-bound content. --%>
                    <asp:Label ID="Label1" runat="server" Text='<%#Eval("Cliente.Nome") %>' />
                </td>
                <td id="Td2" runat="server">
                    <%-- Data-bound content. --%>
                    <asp:Label ID="NameLabel" runat="server" Text='<%#Eval("Unidade.Designacao") %>' />
                </td>
                <td id="Td3" runat="server">
                    <%-- Data-bound content. --%>
                    <asp:LinkButton ID="EditButton" CommandName="Edit"
                                    CommandArgument='<%# Eval("Unidade.IdUnidade")%>' runat="server" Text='<%#GetText(Convert.ToInt64(Eval("NumeroContrato")))%>'></asp:LinkButton>
                </td>
            </tr>
        </ItemTemplate>
    </asp:ListView>
    <asp:HiddenField ID="hfData" runat="server" />
</asp:Content>
